# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Gmail.V1.Model.SmimeInfo do
  @moduledoc """
  An S/MIME email config.

  ## Attributes

  *   `encryptedKeyPassword` (*type:* `String.t`, *default:* `nil`) - Encrypted key password, when key is encrypted.
  *   `expiration` (*type:* `String.t`, *default:* `nil`) - When the certificate expires (in milliseconds since epoch).
  *   `id` (*type:* `String.t`, *default:* `nil`) - The immutable ID for the SmimeInfo.
  *   `isDefault` (*type:* `boolean()`, *default:* `nil`) - Whether this SmimeInfo is the default one for this user's send-as address.
  *   `issuerCn` (*type:* `String.t`, *default:* `nil`) - The S/MIME certificate issuer's common name.
  *   `pem` (*type:* `String.t`, *default:* `nil`) - PEM formatted X509 concatenated certificate string (standard base64 encoding). Format used for returning key, which includes public key as well as certificate chain (not private key).
  *   `pkcs12` (*type:* `String.t`, *default:* `nil`) - PKCS#12 format containing a single private/public key pair and certificate chain. This format is only accepted from client for creating a new SmimeInfo and is never returned, because the private key is not intended to be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword should be set appropriately.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :encryptedKeyPassword => String.t() | nil,
          :expiration => String.t() | nil,
          :id => String.t() | nil,
          :isDefault => boolean() | nil,
          :issuerCn => String.t() | nil,
          :pem => String.t() | nil,
          :pkcs12 => String.t() | nil
        }

  field(:encryptedKeyPassword)
  field(:expiration)
  field(:id)
  field(:isDefault)
  field(:issuerCn)
  field(:pem)
  field(:pkcs12)
end

defimpl Poison.Decoder, for: GoogleApi.Gmail.V1.Model.SmimeInfo do
  def decode(value, options) do
    GoogleApi.Gmail.V1.Model.SmimeInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Gmail.V1.Model.SmimeInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
